<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算器练习</title>
	</head>
	<body>
		<div id="app">
			数据A:<input type= "text" v-model="num1"/>
			数据B:<input type="text"  v-model ="num2" 
			@keyup.enter="addNum"/>
			总数:<span v-text="sum"></span>
		</div>
		<script src="../js/vue.js">	</script>
		<script >
			const app = new Vue({
				el:"#app",
				data:{
					num1:"",
					num2:"",
					sum:""
				},
				methods:{
					addNum(){
						this.sum =parseInt(this.num1)+parseInt(this.num2)
				}
			  }	
			})
		</script>
	</body>
</html>
